<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
<head>
	<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
	<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<link href="${contextPath}/styles/default.css" rel="stylesheet" type="text/css" />
	<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
<title>合格证换证</title>
<script type="text/javascript">
	function jumpPage(page) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/cm/renew/index.do?currentPage=" + page;
		searchForm.submit();
	}

	function editData(id) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/cm/renew/edit.do?currentPage=${currentPage}&entity.id="+id;
		searchForm.submit();
	}
	
	function deleteData(id) {
		if(confirm("确认要删除吗?")) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/cm/renew/destory.do?currentPage=${currentPage}&entity.id="+id;
			searchForm.submit();
		}	  
	}
	
	function choose_user(id_,name_){
		alert("这里是父页面的消息："+id_+"="+name_);
	}
	function selUser(){
		var url= "<s:property value='contextPath'/>/system/user/choose.do?currentPage=${currentPage}&us.isShop=0";
		window.open(url,'选择用户','height=900,width=1024,top=0,left=200,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
	}
	
	function audit(id){
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/cm/renew/preAudit.do?currentPage=${currentPage}&entity.id="+id;
		searchForm.submit();
	}
	
	function confirmAccept(id){
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/cm/renew/preConfirmAccept.do?currentPage=${currentPage}&entity.id="+id;
		searchForm.submit();
	}
	
	
	$(document).ready(function(){
		
		});
</script>
</head>
<body>
<div class="navigation">
  <span>
  <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
   <a href="javascript:window.history.forward();">前进</a>
  <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
   <a href="javascript:window.location.reload();">刷新</a>
  </span>合格证管理&gt;&gt;换证
</div>

<div class="xt_main_right_center">    
<form name="searchForm" id="searchForm" method="post" action="index.do">
	      <table width="100%" border="0" cellpadding="0" cellspacing="0"  style="border-color:#CCCCCC;">
	         <tr>
	        	<td class="left-td-width-bg"><span>申请单号:</span> </td>
	        	<td>
	           		<input type="text" name='search.applyNum'  class="input"  value="<s:property value="search.applyNum"/>"  style='width:120px'/>
	            </td>
	            <td class="left-td-width-bg"><span>店名:</span> </td>
	            <td>
	            	<input type="text" name='search.shop.shopName' class="input"  value="<s:property value="search.shop.shopName"/>" style='width:120px'/>
	            </td>
	        	<td class="left-td-width-bg"><span>金融机构:</span> </td>
	        	<td>
	        		<select  class="input" name="search.financial.name" id="select2">
		        <option  value="" selected="selected">****请选择****</option>
		         <s:iterator value="financials" status="i" id="b">
		          <option <s:if test='search.financial.name.equals(#b.name)'>selected="selected"</s:if>  value="${b.name }">${b.name }</option>
		          </s:iterator>
		      </select>
	            </td>
	            <td class="left-td-width-bg"><span>状态:</span></td>
	            <td> 
	            	<s:select cssClass="input_select_readOnly_95" name="state" list="@com.jysz.certificate.persistence.enums.CertificateRenewState@values()" theme="simple" listKey="index" listValue="name" headerKey="-1" headerValue="--请选择--" value="state"></s:select>
	            </td>
	        </tr>
	       <tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
			    <td height="28" colspan="8" align="right" style="border-bottom:none;">
			    	<input type="button" class="btn_clear_form" onclick="clearForm(this.form);return false;"/>
			    	<input name="" type="submit" name="submit" value=""  class="btn_query"/>
			    </td>
		    </tr>       
	      </table>
      </form>
</div> 
<br/>
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
	     <tr>
	       <td height="25" align="left"><font color="#0066CC"><strong>换证申请列表：</strong></font></td>
	       <td height="25" align="right">
	       <jysz:permission code="CM_RENEW_ADD">
	          <a href="add.do"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a></jysz:permission>
	       </td>
	     </tr>
  </table> 
      
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
  <tr> 
	    <td width="4%" class="top-td-width-bg">序号</td>
	    <td width="10%" class="top-td-width-bg">申请单号</td>
	    <td width="12%" class="top-td-width-bg">4S店</td>
	    <td width="9%" class="top-td-width-bg">金融机构</td>
	    <td width="9%" class="top-td-width-bg">换出供货价</td>
	    <td width="9%" class="top-td-width-bg">换入供货价</td>
	    <td width="12%" class="top-td-width-bg">申请时间</td>
	    <td width="8%" class="top-td-width-bg">申请人</td>
	    <td width="8%" class="top-td-width-bg">状态</td>
	    <td  class="top-td-width-bg">操作</td>
	</tr>
 	<s:iterator value="page.result" status="st">
		<tr>
			<td  class="down-center-td-width-bg">
				<s:property value="#st.index+1"/>
			</td>
			<td  class="down-center-td-width-bg"><s:property value="applyNum" /></td>
			<td  class="down-center-td-width-bg">(<s:property value="shop.shopMark" />)<s:property value="shop.shopName" /></td>
			<td  class="down-center-td-width-bg">
				<s:property value="financial.name" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="formatAmount(supplyPrice)" />
			</td>
			<td  class="down-center-td-width-bg">
				<s:property value="formatAmount(inSupplyPrice)" />
			</td>			
			<td  class="down-left-td-width-bg"><s:property value="applyDate" /></td>
			<td  class="down-center-td-width-bg"><s:property value="applyUser.realName" /></td>
			
			<td  class="down-center-td-width-bg"><s:property value="state.name" /></td>
			
			<td  class="down-center-td-width-bg">
				<a href="view.do?entity.id=<s:property value="id"/>"><img src="${contextPath}/images/chakan.gif" alt="详情" width="16" height="18" border="0" /></a>&nbsp;
				<s:if test="state.index==0||state.index==3">
					 <jysz:permission code="CM_RENEW_EDIT">
						<a href="javascript:editData(<s:property value="id"/>);"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
					 </jysz:permission>
				</s:if>
				<s:if test="state.index==0||state.index==3 ||state.index==1">
					 <jysz:permission code="CM_RENEW_DEL">
						<a href="javascript:deleteData(<s:property value="id"/>);"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
					</jysz:permission>
				</s:if>		
				<s:if test="state.index==1||state.index==5">
					 <jysz:permission code="CM_RENEW_AUDIT">
						<a href="javascript:audit(<s:property value="id"/>);"><img src="${contextPath}/images/audit.png" alt="审核" border="0" /></a>
					</jysz:permission>
				</s:if>
				
				<s:if test="@com.jysz.certificate.persistence.enums.CertificateRenewState@PASSED.equals(state)">
					<a href="javascript:confirmAccept(<s:property value="id"/>);">确认收证</a>
				</s:if>
			</td>
		</tr>
	</s:iterator>
	<tr> 
	 <td height="36" colspan="11" class="down-center-td-width-bg" align="right">
			<%@ include file="/WEB-INF/view/common/pagination.jsp"%>
 		</td>
	</tr>
</table>


	<br/><br/><br/><br/><br/>
	<div align="center"><jsp:include page="/include/footer.inc"></jsp:include></div>
</body>
</html>